home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 15
/
Aminet 15 - Nov 1996.iso
/
Aminet
/
dev
/
gcc
/
ixemsdk.lha
/
man
/
cat3
/
sleep.0
< prev
next >
Wrap
Text File
|
1996-09-02
|
2KB
|
49 lines
SLEEP(3) UNIX Programmer's Manual SLEEP(3)
NNAAMMEE
sslleeeepp - suspend process execution for interval of seconds
SSYYNNOOPPSSIISS
##iinncclluuddee <<uunniissttdd..hh>>
_u_n_s_i_g_n_e_d _i_n_t
sslleeeepp(_u_n_s_i_g_n_e_d _i_n_t _s_e_c_o_n_d_s)
DDEESSCCRRIIPPTTIIOONN
The sslleeeepp() function suspends execution of the calling process until ei-
ther the number of seconds specified by _s_e_c_o_n_d_s have elapsed or a signal
is delivered to the calling process and its action is to invoke a signal-
catching function or to terminate the process. The suspension time may
be longer than requested due to the scheduling of other activity by the
system.
If a timer is already running on the process its state is saved. If the
value _s_e_c_o_n_d_s is more than or equal to the remaining clock time for the
saved timer, the sleep time is set to the remaining clock time. The
state of the previous timer is restored after _s_e_c_o_n_d_s has passed.
This function is implemented using setitimer(2); it requires eight sys-
tem calls each time it is invoked. A similar but less compatible func-
tion can be obtained with a single select(2); such a function would not
restart after signals, but would not interfere with other uses of
setitimer.
RREETTUURRNN VVAALLUUEE
If the sslleeeepp() function returns because the requested time has elapsed,
the value returned will be zero. If the sslleeeepp() function returns due to
the delivery of a signal, the value returned will be the unslept amount
(the request time minus the time actually slept) in seconds.
SSEEEE AALLSSOO
setitimer(2), sigaction(2), sigsuspend(2), alarm(3), pause(3),
usleep(3)
SSTTAANNDDAARRDDSS
The sslleeeepp() function conforms to .
HHIISSTTOORRYY
A sslleeeepp() function appeared in Version 7 AT&T UNIX.
BSD Experimental June 4, 1993 1